# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=libvisio
pkgver=0.1.7
pkgrel=10
pkgdesc="Import filter and tools for MS Visio Diagrams"
url="https://wiki.documentfoundation.org/DLP/Libraries/libvisio"
arch="all"
license="MPL-2.0"
makedepends="doxygen gperf perl icu-dev librevenge-dev libxml2-dev"
checkdepends="icu-data-full"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="https://dev-www.libreoffice.org/src/libvisio/libvisio-$pkgver.tar.xz"

prepare() {
	default_prepare

	update_config_sub
	update_config_guess
}

build() {
	# boost -1.59
	export CPPFLAGS='-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED'
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

check() {
	make check || { cat src/test/test-suite.log; exit 1; }
}

package() {
	make DESTDIR="$pkgdir" install
}

tools() {
	amove usr/bin
}

sha512sums="
c26f67a09fa6a6d0bf6f3fff5590d5cf16983630d4f7cfcf86d9461baec58dbdf7989fd934be6db0639ca043c160aac2d008275afb9e047766bc878ac579a9ea  libvisio-0.1.7.tar.xz
"
